package com.example.mq.consumer;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import com.example.mq.config.*;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


/**
 * @auth 贾枣阳
 * @date 2021/2/3 10:33
 */
@Component
@RabbitListener(queues = "SECOND_QUEUE")
public class SecondConsumer {
    @RabbitHandler
    public void process(String msg, Message message, Channel channel) {
        System.out.println("topic消费者二收到消息："+msg);
       // int temp = 1/0;
    }

}
